package cn.edu.scau.cmi.lishuoxin.client.experiment4;

import Hibernate.cn.edu.scau.cmi.lishuoxin.client.AlertBox;
import cn.edu.scau.cmi.lishuoxin.interProgramming.experiment4.Adapter2;
import cn.edu.scau.cmi.lishuoxin.interProgramming.experiment4.HuaWei;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class AdapterObject extends Application{
	
	private AlertBox alert = new AlertBox();
	@Override
	public void start(Stage primaryStage) throws Exception {
		// TODO Auto-generated method stub
		try {
			StackPane root = new StackPane();
			Button button = new Button("创建对象适配器，使用华为的充电线");
			button.setOnAction(e -> {
				alert.display(new Adapter2(new HuaWei()).huawei());
			});
			root.getChildren().add(button);
			Scene scene = new Scene(root,300,200);
			primaryStage.setTitle("对象适配器");
			primaryStage.setScene(scene);
			primaryStage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		launch(args);
	}
}
